<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>

<!DOCTYPE html>

<html>

<head>

    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<!-- 
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> -->
<meta http-equiv="Content-Type" content="multipart/form-data; charset=utf-8" />
    <title>仪器共享</title>

    <meta name="keywords" content="科研仪器，生命科学仪器，环境检测仪器，实验常用设备，分析仪器">

    <meta name="description" content="中国领先的科研仪器共享平台，让您快速找到各种类型的科学研究仪器。提升闲置仪器利用率，产生更大科研价值。涵盖：生命科学仪器、环境检测仪器、实验常用设备、分析仪器、仪表、物性测试、测量/计量仪器、在线及过程控制仪器。

">
    <!--<link rel="stylesheet" href="new_css/header_footer.css?t=1">-->
    <link rel="stylesheet" href="new_css/lizisepuyi.css">
    <link rel="stylesheet" href="css/reset.css">
    <link rel="stylesheet" href="css/common.css">
    <style>
        input {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        select {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        textarea {
            border: 1px solid #2222;
            border-radius: 5px;
        }
        .mainList .content .right .title{
            /*margin-left: 20px;*/
        }
        .minTitle {
            /*margin-left: 46px;*/
            border-left: 2px solid #ff8a00;
            padding-left: 10px;
            margin-top: 30px;
            font-size: 18px;
            /* font-family: MicrosoftYaHei; */
        }
        .mainList .content .right {
            width: 1178px;
            height: 100%;
            border: 1px solid #d3d3d3;
        }
        .mainList .content .right ul li label {
            width: 98px;
            display: inline-block;
            text-align: left;
            padding-right: 20px;
            /* margin-left: 40px; */
            padding-left: 53px;
        }
        textarea.taxtarea-haha {
            width: 961px;
            height: 306px;
        }
        .mainList .content .right button {
            width: 196px;
            height: 62px;
            text-align: center;
            line-height: 62px;
            background: #ff8a00;
            border: none;
            color: #fff;
            font-size: 26px;
            border-radius: 8px;
            -webkit-border-radius: 8px;
            -moz-border-radius: 8px;
            margin-left: 176px;
            margin-top: 20px;
        }
        .mainList .content .right ul{
            float: none;
        }
        .mainList .content .right ul li input {
            width: 800px;
            height: 54px;
            padding-left: 20px;
            outline: none;
        }
        textarea.taxtarea-haha {
            width: 817px;
            height: 306px;
        }
        .hahahxixihehe{
            vertical-align: top;
        }
    </style>
    <script src="new_js/jquery-1.11.3.js"></script>
    <script>
        $(function() {
            $('#front_header .header_wrap .right').hover(function() {
                $('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon2.png');
                $('#front_header .header_wrap .right .out').show();
            }, function() {
                $('#front_header .header_wrap .right .main .icon img').attr('src', 'images/icon1.png');
                $('#front_header .header_wrap .right .out').hide();
            });
            $('#sorts').on('mouseover', 'li', function() {
                $(this).find('span img').attr('src', 'images/icon4.png');
            });
            $('#sorts').on('mouseout', 'li', function() {
                $(this).find('span img').attr('src', 'images/icon5.png');
            });

            $('.mainList .content .left li').click(function() {
                $(this).addClass('selected').siblings().removeClass('selected');
            });
        });
    </script>
</head>
<body style="background:#fff;">

	<%@include file="/header4.jsp"%>

    


</header>

<div class="mainList">
    <div class="bNav">您的位置：实验订单管理><span>上传结果</span></div>
    <div class="content">
        <div class="right">
            <div class="title"><span>上传结果</span></div>
			<form enctype="multipart/form-data" method="post" id="upload">
            <div class="form">
                <ul>
                    <li>
                        <label>服务名称</label>
                        <input id="serviceName" type="text"  /> <input id="oid" name="oid" type="hidden"  />
                    </li>

                    <li>
                        <label>申请人</label>
                        <input id="applicant" type="text"  />
                    </li>

                    <li>
                        <label>订单编号</label>
                        <input id="orderNum" type="text"  />
                    </li>

                    <li>
                        <label class="hahahxixihehe">结果描述</label>
                        <textarea id="description" name="description" class="taxtarea-haha"></textarea>
                    </li>

                    <li>
                        <label>上传附件</label>
                        <input id="file1" name="file1" type="file" style="vertical-align: middle; height: 35px !important; padding-top: 13px;" />
                    </li>

                    <!-- <li>
                        <label>时间</label>
                        <input type="text"  />
                    </li> -->

                    <li>
                        <label>填写人</label>
                        <input id="written" name="written" type="text"  />
                    </li>



                </ul>
            </div>








</form>
            <button class="btn-submit" id="btn" onclick="upload()">确认</button>
        </div>
    </div>

</div>

<!--footer-->
<footer>
    <div class="foot clearfix">
        <p>&copy; 2015-2020 科研仪器 版权所有 技术支持：科研仪器共享平台 支持电话：010-123658987 </p>
    </div>
</footer>

<script src="js/jquery-1.11.3.js"></script>
<script src="js/common.js"></script>
	<script>
		$(document).ready(function() {
			$.ajax({
				url:Server + "/orderRelevant/getControlUserByUid",
				data:{
					"uid":$("#useridoflogin").val()
				},
				dataType:"json",
				type:"POST",
				async:"false", 
				success : function(data){
					$("#written").val(data.realname);
				}
			}); 
			
			$.ajax({
				url:Server + "/orderRelevant/getServiceOrder",
				data:{
					"oid":GetUrlByParamName("oid")
				},
				dataType:"json",
				type:"POST",
				async:"false", 
				success : function(data){
					$("#orderNum").val(data.number);
					$.ajax({
						url:Server + "/serviceRelevant/getServiceInfo",
						data:{
							"serviceId":data.inId
						},
						dataType:"json",
						type:"POST",
						async:"false", 
						success : function(data2){
							$("#serviceName").val(data2.serviceName);
						}
					});
					$.ajax({
						url:Server + "/orderRelevant/getConsumUserByUid",
						data:{
							"uid":data.cuId
						},
						dataType:"json",
						type:"POST",
						async:false, 
						success : function(data3){
							$("#applicant").val(data3.realname);
						}
					});
				}
			});
			
			/*  $("#btn").click(function(){
			 	$.ajax({
					url:Server + "/orderRelevant/uploadResult",
					data:{
						"file":$("#upload").val(),
						"written":$("#written").val(),
						"description":$("#description").val(),
						"oid":GetUrlByParamName("oid")
					},
					//dataType:"json",
					type:"POST",
					success : function(data){
						alert(data);
					}
				});
            }) */
		})
			$("#oid").val(GetUrlByParamName("oid"));
		
		function upload(){
			//获得文件名称
			var fileName = $('#file1').val(); 
			//截取文件类型,如(.xls)
			var fileType = fileName.substr(fileName.lastIndexOf("."), fileName.length);
			////验证文件类型
			if (fileType == '.xls' || fileType == '.doc' || fileType == '.docx' || fileType == '.pdf') {
				$.ajax({
					url :Server + "/orderRelevant/uploadResult", //上传地址		
					type : 'POST',
					cache : false,
					data : new FormData($('#upload')[0]),
					processData : false,
					 async:false,
					contentType : false,
					success : function(data) {																			 
								alert(data);
								$(location).attr('href', 'book_admin26_1');
								return false;																		
					},
					error: function(data){
						alert("上传失败");
					}
				});
			}else {
				$("#fileTypeError").html('*上传文件类型错误,支持类型: .doc .docx ');
			}
			
		}
		
		function GetUrlByParamName(name) {
  			 var reg = new RegExp("(^|&)"+ name +"=([^&]*)(&|$)");
 			 var URL =  decodeURI(window.location.search);
  			 var r = URL.substr(1).match(reg);
 			 if(r!=null){
 		        //decodeURI() 函数可对 encodeURI() 函数编码过的 URI 进行解码
 		         return decodeURI(r[2]);
  			 };
  		     return null;
 		};
	</script>
<style>
	.mainList .content .right .btn-submit {
    width: 196px;
    height: 62px;
    text-align: center;
    line-height: 62px;
    background: #ff8a00;
    border: none;
    color: #fff;
    font-size: 26px;
    border-radius: 8px;
    -webkit-border-radius: 8px;
    -moz-border-radius: 8px;
    margin: 20px 0 50px 176px;
    display: block;
}
</style>
	<style>
	.mainList .content .right {
	width:1157px;
/* 	float:right; */
	height:100%;
	min-height: 1000px;
	padding:0 20px;
	border:1px solid #d3d3d3;
}
	</style>

</body>

</html>